package ncc.sso.bs;

import java.util.HashMap;
import java.util.Map;

public class PUMAToken {

    private static PUMAToken instance;
    private PUMAToken(){}
    public static PUMAToken getInstance(){
        if(instance == null){
            synchronized(PUMAToken.class){
                if(instance == null){
                    instance = new PUMAToken();
                }
            }
        }
        return instance;
    }

    private Map<String, String> tokenMap = new HashMap<>();

    public void registerToken(String userCode,String token){
        tokenMap.put(userCode,token);
    }

    public String fetchToken(String userCode) {
        return tokenMap.remove(userCode);
    }
    
}
